﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Documents;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using 纸片人.CalculateControls;
using 纸片人.win2dEffectControl.DataClass;

// The Templated Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234235

namespace 纸片人.win2dEffectControl
{
    public sealed class WaveRippleEffectControl : EffectControl
    {
        public WaveRippleEffectControl()
        {
            this.DefaultStyleKey = typeof(WaveRippleEffectControl);
            OneEffetData = new WaveRippleEffectData();
        }

        public override EffectOneSourceData OneEffetData { get; set; }

        protected override void OnApplyTemplate()
        {
            base.OnApplyTemplate();
            SetEffectName("水波效果：", "WaveRippleEffect");

            var phasehXTextBoxSlider = GetTemplateChildFormName<TextBoxSlider>("phasehXTextBoxSlider");
            SetTextBoxSlider(phasehXTextBoxSlider, OneEffetData, nameof(WaveRippleEffectData.Phase));

            var amplitudeTextBoxSlider = GetTemplateChildFormName<TextBoxSlider>("amplitudeTextBoxSlider");
            SetTextBoxSlider(amplitudeTextBoxSlider, OneEffetData, nameof(WaveRippleEffectData.Amplitude));

            var waveNumberTextBoxSlider = GetTemplateChildFormName<TextBoxSlider>("waveNumberTextBoxSlider");
            SetTextBoxSlider(waveNumberTextBoxSlider, OneEffetData, nameof(WaveRippleEffectData.WaveNumber));

            var radiusTextBoxSlider = GetTemplateChildFormName<TextBoxSlider>("radiusTextBoxSlider");
            SetTextBoxSlider(radiusTextBoxSlider, OneEffetData, nameof(WaveRippleEffectData.Radius));

            var positionVector2Control = GetTemplateChildFormName<Vector2Control>("positionVector2Control");
            SetVector2Control(positionVector2Control, OneEffetData, nameof(WaveRippleEffectData.Position));

        }


    }
}